<%--
  Created by IntelliJ IDEA.
  User: caojian
  Date: 2017/3/10
  Time: 下午5:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="xmb" uri="http://xmb.suishoupai.com/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>买家列表</title>
    <jsp:include page="common/common_css.jsp"/>
</head>
<body>
<jsp:include page="common/header.jsp"/>
<div class="ui main container">
    <label class="ui right floated">
        总共${userBuys.total}位买家
    </label>
    <table class="ui celled padded table">
        <thead>
        <tr>
            <th class="center aligned">id</th>
            <th class="center aligned">名称</th>
            <th class="center aligned">评分</th>
            <th class="center aligned">时间</th>
            <th class="center aligned">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:choose>
            <c:when test="${fn:length(userBuys.list) > 0}">
                <c:forEach items="${userBuys.list}" var="userBuy">
                    <tr data-id="${userBuy.userId}">
                        <td class="center aligned">${userBuy.userId}</td>
                        <td class="center aligned">${userBuy.name}</td>
                        <td class="center aligned">${userBuy.score}</td>
                        <td class="center aligned">
                            <xmb:formatDate value="${userBuy.createTime}"/>
                        </td>
                        <td class="center aligned">
                            <a href="${pageContext.request.contextPath}/userBuy/${userBuy.userId}/orders">查看他的订单</a>
                        </td>
                    </tr>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <tr>
                    <td class="center aligned" colspan="5">暂时还没有一个买家</td>
                </tr>
            </c:otherwise>
        </c:choose>
        </tbody>
        <tfoot>
        <tr>
            <th colspan="5" class="center aligned">
                <c:set var="pagination" scope="session" value="${userBuys}"/>
                <c:set var="paginationAction" scope="session" value="userBuy"/>
                <jsp:include page="common/page.jsp"/>
            </th>
        </tr>
        </tfoot>
    </table>
</div>

<jsp:include page="common/footer.jsp"/>
<jsp:include page="common/common_js.jsp"/>
<script>
    $(function () {

    });
</script>
</body>
</html>
